
package model;
/**
 * @ Authors:
 * 
 * @Veronique De Laet
 * @Johan Willems
 * @Pierre Delaere
 * 
 * @version 2011
 */
public class CursistFactory {

	private static CursistFactory uniqueInstance;
	Cursist cursist = null;
	private int cursistNummer = 0;
	
	private CursistFactory() {}
	
	public static CursistFactory getInstance()
	{
		if (uniqueInstance == null) {
			uniqueInstance = new CursistFactory(); 
		}
		return uniqueInstance;
	}
	
	public Cursist newCursist(int cursistType)
	{
		switch (cursistType){
		case 0:
			cursist = new Cursist();
			break;
		case 1:
			cursist = new HerscholingCursist();
			break;
		case 2:
			cursist = new VrijeCursist();
			break;
		}
		cursistNummer++;
		cursist.setCursistNummer(String.format("%06d",cursistNummer));
		System.out.println(cursist.getCursistNummer());
		return cursist;
	}
}

